package com.example.chapter03;

import android.os.Bundle;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class TextViewActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // 引入布局
        setContentView(R.layout.activity_text_view);
        // 根据id在layout获取TextView
        TextView tv_HW = findViewById(R.id.tv_HW);
        // 设置文本
        tv_HW.setText("你好，安卓");
        // 也可以应用/values/string.xml中定义的字符
//        tv_HW.setText(R.string.tv_hello);
    }
}
